{extend name='main'}

{block name="button"}
{if auth("add")}
<button data-open='{:url("add")}'  class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
{/if}
{/block}

{block name="content"}

<div class="think-box-shadow">

    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>标题</th>
            <th class='text-left nowrap'>地区</th>
            <th class='text-left nowrap'>地址</th>
            <th class='text-left nowrap'>类型</th>
            <th class='text-left nowrap'>电话</th>
            <th class='text-left nowrap'>微信</th>
            <th class='text-left nowrap'>邮箱</th>
            <th class='text-left nowrap'>状态</th>
            <th class='text-left nowrap'>点击数</th>
            <th class='text-left nowrap'>发布时间</th>
            <th class='text-center nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-sort-td'>
                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort|default=''}" class="list-sort-input">
            </td>
            <td class='text-left' title="{$vo.title|default=''}">
                {$vo.title| default=''|sub_str=###,30}
            </td>
            <td class='text-left'>
                {$vo.region.name| default=''}
            </td>
            <td class='text-left' title="{$vo.address|default=''}">
                {$vo.address| default=''|sub_str=###,30}
            </td>
            <td class='text-left'>
                {$vo.cate.name| default=''}
            </td>
            <td class='text-left'>
                {$vo.mobile_cn| default=''} / {$vo.mobile_ind| default=''}
            </td>
            <td class='text-left'>
                {$vo.wechat| default=''}
            </td>
            <td class='text-left'>
                {$vo.email| default=''}
            </td>
            <td class='text-left' >
                {notempty name='vo.status'}
                {switch vo.status }
                {case 1 }<span class="color-green">正常</span>{/case}
                {case 0}<span class="color-red">禁用</span>{/case}
                {default /}
                {/switch}
                {/notempty}
            </td>
            <td class="text-left nowrap">
                {$vo.views|default=''}
            </td>
            <td class="text-left nowrap">
                日期：{$vo.create_at|default=''|str_replace=' ','<br><span class="color-desc">时间：',###|raw}</span>
            </td>
            <td class='text-right operator'>
                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}
                {if auth("remove")}
                <a class="layui-btn layui-btn-danger layui-btn-sm" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
<style>
.operator a{margin-bottom: 5px;}
</style>
{/block}
